#pragma once

#include "../DefinesCore.hpp"
#include <functional>
#include <thread>

CYBERTRON_BEGIN

class UtilCRT
{
public:
	CybertronCoreAPI static void initialize();
	CybertronCoreAPI static void shutdown();

	CybertronCoreAPI static void call(
		const char* functionName, 
		std::function<void()> func);

	CybertronCoreAPI static std::shared_ptr<std::thread> startThread(
		const char* threadName,
		std::function<void()> threadProc);
};

class UtilCRTAutoInitialize
{
public:
	UtilCRTAutoInitialize()
	{
		UtilCRT::initialize();
	}

	~UtilCRTAutoInitialize()
	{
		UtilCRT::shutdown();
	}
};

CYBERTRON_END
